import wsgi_http
import thread
import random
import time

# DO NOT USE; THIS PROTOTYPE DOESN'T WORK CORRECTLY, IT OVERWRITES NODES
# CHECK IT OUT; THERE IS NO "MASTER" NODE AFTER EXECUTING FOR FEW SECONDS,
# ALL NODES ARE DUMB

thread.start_new(wsgi_http.start_node, (100,5879,"master"))

time.sleep(4)

print "master should be working"

for port in range(5880, 5880+29):
	print "New node in port ", port
	thread.start_new(wsgi_http.start_node, (random.randint(1,99),port,"dumb"))
	time.sleep(4)


wsgi_http.start_node(random.randint(1,99),5880+30,"dumb")
